Question: If A=1, B=1, C=0, D=1, what is the output?
Answer: 0
Step 1: AND gate: A=1 AND B=1 → 1
Step 2: OR gate: C=0 OR D=1 → 1
Step 3: XOR gate: 1 XOR 1 → 0 (same values)
Question: If A = 0 and B = 1, what is the output?
Answer: 1
Step 1: NOT gate converts A=0 to 1
Step 2: AND gate with 1 (from NOT) and B=1 gives 1
Chapter 3: Mastering Digital Logic
Let's review all 7 logic gates with correct symbols, truth tables, and circuit exercises!
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| A | Output (Y) |
|---|---|
| 0 | 1 |
| 1 | 0 |
The small circle (○) means inversion!
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Called the "Universal Gate" - can build any gate!
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
The extra curved line makes it exclusive!
| A | B | Output (Y) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Also called the "Equality Checker"!
All inputs = 1
Any input = 1
Inverts input
Inputs different
NOT + AND
NOT + OR
Inputs same
Question: If A = 1 and B = 0, what is the output?
Answer: 0
AND gate needs both inputs to be 1. Since B = 0, the output is 0.
Question: If A = 0 and B = 0, what is the output?
Answer: 0
OR gate needs at least one input to be 1. Both are 0, so output is 0.
Question: If A = 1, what is the output?
Answer: 0
NOT gate inverts: 1 becomes 0, 0 becomes 1.
Question: If A = 1 and B = 1, what is the output?
Answer: 0
XOR outputs 1 only when inputs are different. Both are 1 (same), so output is 0.
Question: If A = 1 and B = 1, what is the output?
Answer: 0
NAND is the opposite of AND. When both inputs are 1, AND would give 1, but NAND inverts it to 0.
Question: If A = 0 and B = 0, what is the output?
Answer: 1
NOR outputs 1 only when all inputs are 0. Both inputs are 0, so output is 1!
Question: If A = 1, B = 0, and C = 1, what is the output?
Answer: 1
Step 1: AND gate with A=1 and B=0 gives 0
Step 2: OR gate with 0 (from AND) and C=1 gives 1
A ──→ [NOT] ──┐
├── [AND] ──→ Output
B ────────────┘
Question: If A = 0 and B = 1, what is the output?
Answer: 1
Step 1: NOT gate converts A=0 to 1
Step 2: AND gate with 1 (from NOT) and B=1 gives 1
Question: If A = 1 and B = 0, what is the output?
Answer: 0
Step 1: XOR with A=1 and B=0 gives 1 (different)
Step 2: NOT gate inverts 1 to 0
Bonus: XOR → NOT is the same as XNOR!
Question: If A = 1, B = 0, and C = 1, what is the final output?
Answer: 0
Step 1: XOR with A=1 and B=0 gives 1 (different)
Step 2: NOT converts C=1 to 0
Step 3: AND with 1 (XOR) and 0 (NOT) gives 0
Build a circuit that outputs 1 only when exactly one input is 1, but not both.
Answer: Use an XOR gate!
Build a circuit that outputs 1 when both inputs are the same.
Answer: Use an XNOR gate!
Build a circuit that always outputs the opposite of input A.
Answer: Use a NOT gate!
AND Gate: Car only starts when key is inserted AND seatbelt is fastened
OR Gate: Alarm triggers if door opens OR window breaks
XOR Gate: Light toggles when either of two switches changes state
XNOR Gate: Checks if entered password matches stored password
NOT Gate: When button is NOT pressed, light is ON
Multiple Gates: Complex combinations of gates process button presses
1. Which gate is called the "universal gate"?
NAND gate - You can build any other gate using only NAND gates!
2. What does the small circle (○) on a gate symbol mean?
Inversion (NOT operation) - The output is inverted/flipped!
3. Which gate outputs 1 only when inputs are different?
XOR gate - Exclusive OR checks for difference!
4. How many rows are in a truth table for a 2-input gate?
4 rows - For n inputs, you need 2^n rows. With 2 inputs: 2² = 4 rows!
5. Which gate is also called the "Equality Checker"?
XNOR gate - It outputs 1 when both inputs are the same (equal)!
Try all possible combinations:
Answers:
Bonus: This is actually a NOR gate!
A ──┐
├── [AND] ──┐
B ──┘ │
C ──┐ │
├── [OR] ───┤
D ──┘ │
├── [XOR] ──→ Output
│
Question: If A=1, B=1, C=0, D=1, what is the output?
Answer: 0
Step 1: AND gate: A=1 AND B=1 → 1
Step 2: OR gate: C=0 OR D=1 → 1
Step 3: XOR gate: 1 XOR 1 → 0 (same values)
🎉 Congratulations!
You've completed the Logic Gates Review for Chapter 3!
You now understand all 7 logic gates, their symbols, truth tables, and how to build complex circuits.